package com.sinbad.consumer.receive.topic;

import org.springframework.amqp.core.ExchangeTypes;
import org.springframework.amqp.rabbit.annotation.*;
import org.springframework.stereotype.Component;


@Component
@RabbitListener(bindings = @QueueBinding(
        value = @Queue(value = "topicQueue.A", durable = "true", autoDelete = "false"),
        exchange = @Exchange(value = "topicExchange", type = ExchangeTypes.TOPIC),
        //topic.#表示 可以接收以topic开头的任意子孙路径下的队列
        key = "topic.#"
))
public class TopicQueueAReceive {

    /**
     * @Description: topic
     */
    @RabbitHandler
    public void message(String user) {
        System.out.println("topicMode开始消费消息：" + user);
    }

}
